<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="col-sm-12 search-collapse">
			<form id="type-form">
				<div class="select-list">
					<ul>
						<li>
							用户ID号：<input type="text" name="memberId"/>
						</li>
						<li>
							昵称：<input type="text" name="nickName"/>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>
		<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
			<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sj:personalData:add">
				<i class="fa fa-plus"></i> 添加
			</a>
			<!--<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="sj:personalData:edit">
	            <i class="fa fa-edit"></i> 修改
	        </a>-->
			<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sj:personalData:remove">
				<i class="fa fa-remove"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('sj:personalData:edit')}]];
        var removeFlag = [[${@permission.hasPermi('sj:personalData:remove')}]];
        var datas = [[${@dict.getType('sj_sex')}]];
        var prefix = ctx + "sj/personalData";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "个人资料",
                search: false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '序号',
                    formatter:function(value, row , index){
                        return index+1;
                    }
				},
				{
					field : 'memberId', 
					title : '用户ID号'
				},
				{
					field : 'nickName', 
					title : '昵称' 
				},
				{
					field : 'sex', 
					title : '性别',
					formatter:function (value, row, index) {
						return $.table.selectDictLabel(datas,value);
                    }
				},
				{
					field : 'birthday', 
					title : '出生日期' 
				},
				{
					field : 'height', 
					title : '身高' 
				},
				{
					field : 'weight', 
					title : '体重' 
				},
				{
					field : 'declaration', 
					title : '交友宣言' 
				},
				{
					field : 'objective', 
					title : '交友目的' 
				},
				/*{
					field : 'occupation', 
					title : '职业' 
				},
				{
					field : 'hobby', 
					title : '爱好' 
				},
				{
					field : 'speciality', 
					title : '特长' 
				},
				{
					field : 'loveConcept', 
					title : '恋爱观念' 
				},
				{
					field : 'firstTimeHope', 
					title : '首次见面希望' 
				},
				{
					field : 'likePlace', 
					title : '喜欢相约地点' 
				},
				{
					field : 'recentOnLineTime', 
					title : '最近上线时间' 
				},*/
				{
					field : 'backgroundPicture', 
					title : '背景图片',
                    formatter: function(value, row, index) {
                        return "<img width='80px' height='80px' src='"+value+"'/>";
                    }
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>